Capsule API Example
Loading...
Searching...
No Matches
CDevice.h
Go to the documentation of this file.
1// Copyright. 2019 - 2024 PSBD. All rights reserved.
2
3#pragma once
4
5#include "CDefinesPrivate.h"
6#include "CDeviceLocator.h"
7#include "CEEGArtifacts.h"
8#include "CEEGTimedData.h"
9#include "CError.h"
10#include "CPSDData.h"
11#include "CResistances.h"
12
13#include <stdbool.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
24CLC_CLASS_WN(DevicePrivate, clCDevice);
25
35
44
45CLC_STRUCT_WNN(DeviceChannelNames, clCDevice_ChannelNames, device);
46
55CL_DLL clCDevice clCDeviceLocator_CreateDevice(clCDeviceLocator locator, const char* deviceSerial, clCError* error) NOEXCEPT;
56
59
60typedef void (*clCDevice_OnResistanceUpdateHandler)(clCDevice, clCResistance) NOEXCEPT;
62
63typedef void (*clCDevice_OnBatteryChargeUpdateHandler)(clCDevice, uint8_t) NOEXCEPT;
65
68
69typedef void (*clCDevice_EEGDataHandler)(clCDevice, clCEEGTimedData) NOEXCEPT;
71
72typedef void (*clCDevice_PSDDataHandler)(clCDevice, clCPSDData) NOEXCEPT;
74
75typedef void (*clCDevice_EEGArtifactsHandler)(clCDevice, clCEEGArtifacts) NOEXCEPT;
77
78typedef void (*clCDevice_ErrorHandler)(clCDevice, const char*) NOEXCEPT;
80
90CL_DLL void clCDevice_Connect(clCDevice device, bool bipolarChannels, clCError* error) NOEXCEPT;
98CL_DLL void clCDevice_Disconnect(clCDevice device, clCError* error) NOEXCEPT;
106CL_DLL uint8_t clCDevice_GetBatteryCharge(clCDevice device, clCError* error) NOEXCEPT;
107
115CL_DLL const char* clCDevice_GetFirmwareVersion(clCDevice device, clCError* error) NOEXCEPT;
116
123CL_DLL void clCDevice_Start(clCDevice device, clCError* error) NOEXCEPT;
130CL_DLL void clCDevice_Stop(clCDevice device, clCError* error) NOEXCEPT;
131
138
145CL_DLL bool clCDevice_IsConnected(clCDevice device, clCError* error) NOEXCEPT;
146
154CL_DLL clCDeviceInfo clCDevice_GetInfo(clCDevice device, clCError* error) NOEXCEPT;
155
163CL_DLL float clCDevice_GetEEGSampleRate(clCDevice device, clCError* error) NOEXCEPT;
164
172CL_DLL float clCDevice_GetPPGSampleRate(clCDevice device, clCError* error) NOEXCEPT;
180CL_DLL float clCDevice_GetMEMSSampleRate(clCDevice device, clCError* error) NOEXCEPT;
188CL_DLL int32_t clCDevice_GetPPGIrAmplitude(clCDevice device, clCError* error) NOEXCEPT;
196CL_DLL int32_t clCDevice_GetPPGRedAmplitude(clCDevice device, clCError* error) NOEXCEPT;
197
205CL_DLL clCDevice_ChannelNames clCDevice_GetChannelNames(clCDevice device, clCError* error) NOEXCEPT;
206
207CL_DLL int32_t clCDevice_ChannelNames_GetChannelsCount(clCDevice_ChannelNames deviceChannels, clCError* error) NOEXCEPT;
208
209CL_DLL int32_t clCDevice_ChannelNames_GetChannelIndexByName(clCDevice_ChannelNames deviceChannels, const char* channelName, clCError* error) NOEXCEPT;
210
211CL_DLL const char* clCDevice_ChannelNames_GetChannelNameByIndex(clCDevice_ChannelNames deviceChannels, int32_t channelIndex, clCError* error) NOEXCEPT;
212
218CL_DLL void clCDevice_Release(clCDevice device) NOEXCEPT;
219
220#ifdef __cplusplus
221}
222#endif
#define NOEXCEPT
Definition CDefinesPrivate.h:82
#define CL_DLL
Definition CDefinesPrivate.h:51
#define CLC_CLASS_WN(Wrapped, Name)
Definition CDefinesPrivate.h:84
CL_DLL void clCDevice_Disconnect(clCDevice device, clCError *error) NOEXCEPT
CL_DLL void clCDevice_SetOnEEGDataEvent(clCDevice device, clCDevice_EEGDataHandler handler) NOEXCEPT
CL_DLL void clCDevice_Release(clCDevice device) NOEXCEPT
CL_DLL clCDevice_Mode clCDevice_GetMode(clCDevice device) NOEXCEPT
CL_DLL void clCDevice_Start(clCDevice device, clCError *error) NOEXCEPT
Start device.
void(* clCDevice_OnResistanceUpdateHandler)(clCDevice, clCResistance) NOEXCEPT
Definition CDevice.h:60
clCDevice_Mode
Definition CDevice.h:26
@ clCDevice_Mode_StartPPG
Definition CDevice.h:32
@ clCDevice_Mode_StartMEMS
Definition CDevice.h:30
@ clCDevice_Mode_Signal
Definition CDevice.h:28
@ clCDevice_Mode_Resistance
Definition CDevice.h:27
@ clCDevice_Mode_SignalAndResist
Definition CDevice.h:29
@ clCDevice_Mode_StopPPG
Definition CDevice.h:33
@ clCDevice_Mode_StopMEMS
Definition CDevice.h:31
void(* clCDevice_EEGArtifactsHandler)(clCDevice, clCEEGArtifacts) NOEXCEPT
Definition CDevice.h:75
CL_DLL clCDevice clCDeviceLocator_CreateDevice(clCDeviceLocator locator, const char *deviceSerial, clCError *error) NOEXCEPT
CL_DLL const char * clCDevice_GetFirmwareVersion(clCDevice device, clCError *error) NOEXCEPT
Get device firmware version. Only contains info after device is connected.
CL_DLL void clCDevice_SetOnConnectionStatusChangedEvent(clCDevice device, clCDevice_ConnectionStatusChangedHandler handler) NOEXCEPT
void(* clCDevice_OnBatteryChargeUpdateHandler)(clCDevice, uint8_t) NOEXCEPT
Definition CDevice.h:63
CL_DLL bool clCDevice_IsConnected(clCDevice device, clCError *error) NOEXCEPT
CL_DLL void clCDevice_SetOnBatteryChargeUpdateEvent(clCDevice device, clCDevice_OnBatteryChargeUpdateHandler) NOEXCEPT
CL_DLL void clCDevice_SetOnPSDDataEvent(clCDevice device, clCDevice_PSDDataHandler handler) NOEXCEPT
CL_DLL void clCDevice_Connect(clCDevice device, bool bipolarChannels, clCError *error) NOEXCEPT
CL_DLL int32_t clCDevice_ChannelNames_GetChannelsCount(clCDevice_ChannelNames deviceChannels, clCError *error) NOEXCEPT
void(* clCDevice_ConnectionStatusChangedHandler)(clCDevice, clCDevice_ConnectionStatus) NOEXCEPT
Definition CDevice.h:57
CL_DLL const char * clCDevice_ChannelNames_GetChannelNameByIndex(clCDevice_ChannelNames deviceChannels, int32_t channelIndex, clCError *error) NOEXCEPT
CL_DLL void clCDevice_SetOnErrorEvent(clCDevice device, clCDevice_ErrorHandler handler) NOEXCEPT
clCDevice_ConnectionStatus
Device connection status.
Definition CDevice.h:39
@ clCDevice_ConnectionState_Connected
Definition CDevice.h:41
@ clCDevice_ConnectionState_Disconnected
Definition CDevice.h:40
@ clCDevice_ConnectionState_UnsupportedConnection
Definition CDevice.h:42
CL_DLL int32_t clCDevice_GetPPGIrAmplitude(clCDevice device, clCError *error) NOEXCEPT
CL_DLL int32_t clCDevice_ChannelNames_GetChannelIndexByName(clCDevice_ChannelNames deviceChannels, const char *channelName, clCError *error) NOEXCEPT
CL_DLL float clCDevice_GetEEGSampleRate(clCDevice device, clCError *error) NOEXCEPT
CL_DLL int32_t clCDevice_GetPPGRedAmplitude(clCDevice device, clCError *error) NOEXCEPT
void(* clCDevice_EEGDataHandler)(clCDevice, clCEEGTimedData) NOEXCEPT
Definition CDevice.h:69
void(* clCDevice_PSDDataHandler)(clCDevice, clCPSDData) NOEXCEPT
Definition CDevice.h:72
CLC_STRUCT_WNN(DeviceChannelNames, clCDevice_ChannelNames, device)
CL_DLL clCDevice_ChannelNames clCDevice_GetChannelNames(clCDevice device, clCError *error) NOEXCEPT
CL_DLL uint8_t clCDevice_GetBatteryCharge(clCDevice device, clCError *error) NOEXCEPT
Get device battery charge.
CL_DLL float clCDevice_GetPPGSampleRate(clCDevice device, clCError *error) NOEXCEPT
CL_DLL clCDeviceInfo clCDevice_GetInfo(clCDevice device, clCError *error) NOEXCEPT
CL_DLL void clCDevice_Stop(clCDevice device, clCError *error) NOEXCEPT
Stop device.
void(* clCDevice_ModeSwitchedHandler)(clCDevice, clCDevice_Mode) NOEXCEPT
Definition CDevice.h:66
void(* clCDevice_ErrorHandler)(clCDevice, const char *) NOEXCEPT
Definition CDevice.h:78
CL_DLL void clCDevice_SetOnResistanceUpdateEvent(clCDevice device, clCDevice_OnResistanceUpdateHandler handler) NOEXCEPT
CL_DLL void clCDevice_SetOnEEGArtifactsEvent(clCDevice device, clCDevice_EEGArtifactsHandler handler) NOEXCEPT
CL_DLL float clCDevice_GetMEMSSampleRate(clCDevice device, clCError *error) NOEXCEPT
CL_DLL void clCDevice_SetOnModeSwitchedEvent(clCDevice device, clCDevice_ModeSwitchedHandler handler) NOEXCEPT
Definition CError.h:28